Optimal. Leaf size=59 \[ \frac {a (i A+B) c^3 (1-i \tan (e+f x))^3}{3 f}-\frac {a B c^3 (1-i \tan (e+f x))^4}{4 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45}
\begin {gather*} \frac {a c^3 (B+i A) (1-i \tan (e+f x))^3}{3 f}-\frac {a B c^3 (1-i \tan (e+f x))^4}{4 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3669
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^3 \, dx &=\frac {(a c) \text {Subst}\left (\int (A+B x) (c-i c x)^2 \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left ((A-i B) (c-i c x)^2+\frac {i B (c-i c x)^3}{c}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a (i A+B) c^3 (1-i \tan (e+f x))^3}{3 f}-\frac {a B c^3 (1-i \tan (e+f x))^4}{4 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(161\) vs. \(2(59)=118\).
time = 1.30, size = 161, normalized size = 2.73 \begin {gather*} \frac {a c^3 \sec (e) \sec ^4(e+f x) (3 (-2 i A+B) \cos (e)+3 (-i A+B) \cos (e+2 f x)-3 i A \cos (3 e+2 f x)+3 B \cos (3 e+2 f x)-6 A \sin (e)-3 i B \sin (e)+5 A \sin (e+2 f x)+i B \sin (e+2 f x)-3 A \sin (3 e+2 f x)-3 i B \sin (3 e+2 f x)+2 A \sin (3 e+4 f x)+i B \sin (3 e+4 f x))}{12 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 63, normalized size = 1.07
method | result | size |
risch | \(\frac {4 a \,c^{3} \left (2 i A \,{\mathrm e}^{2 i \left (f x +e \right )}+2 B \,{\mathrm e}^{2 i \left (f x +e \right )}+2 i A -B \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{4}}\) | \(56\) |
derivativedivides | \(\frac {a \,c^{3} \left (-\frac {B \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (2 i B +A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {\left (2 i A -B \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) | \(63\) |
default | \(\frac {a \,c^{3} \left (-\frac {B \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (2 i B +A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3}-\frac {\left (2 i A -B \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) | \(63\) |
norman | \(\frac {A a \,c^{3} \tan \left (f x +e \right )}{f}-\frac {\left (2 i B a \,c^{3}+A a \,c^{3}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {\left (-2 i A a \,c^{3}+B a \,c^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {B a \,c^{3} \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}\) | \(91\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 76, normalized size = 1.29 \begin {gather*} -\frac {3 \, B a c^{3} \tan \left (f x + e\right )^{4} + 4 \, {\left (A + 2 i \, B\right )} a c^{3} \tan \left (f x + e\right )^{3} - 6 \, {\left (-2 i \, A + B\right )} a c^{3} \tan \left (f x + e\right )^{2} - 12 \, A a c^{3} \tan \left (f x + e\right )}{12 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.57, size = 91, normalized size = 1.54 \begin {gather*} -\frac {4 \, {\left (2 \, {\left (-i \, A - B\right )} a c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-2 i \, A + B\right )} a c^{3}\right )}}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 136 vs. \(2 (46) = 92\).
time = 0.31, size = 136, normalized size = 2.31 \begin {gather*} \frac {8 i A a c^{3} - 4 B a c^{3} + \left (8 i A a c^{3} e^{2 i e} + 8 B a c^{3} e^{2 i e}\right ) e^{2 i f x}}{3 f e^{8 i e} e^{8 i f x} + 12 f e^{6 i e} e^{6 i f x} + 18 f e^{4 i e} e^{4 i f x} + 12 f e^{2 i e} e^{2 i f x} + 3 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 105 vs. \(2 (51) = 102\).
time = 0.75, size = 105, normalized size = 1.78 \begin {gather*} -\frac {4 \, {\left (-2 i \, A a c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 2 \, B a c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} - 2 i \, A a c^{3} + B a c^{3}\right )}}{3 \, {\left (f e^{\left (8 i \, f x + 8 i \, e\right )} + 4 \, f e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 4 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.47, size = 76, normalized size = 1.29 \begin {gather*} -\frac {\frac {B\,a\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^4}{4}+\frac {a\,\left (A+B\,2{}\mathrm {i}\right )\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3}+\frac {a\,\left (-B+A\,2{}\mathrm {i}\right )\,c^3\,{\mathrm {tan}\left (e+f\,x\right )}^2}{2}-A\,a\,c^3\,\mathrm {tan}\left (e+f\,x\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________